import createRouteMap from './create-route-map.js'

export default function createMatcher(routes) {
  const {pathMap} = createRouteMap(routes)

  // 1. 动态添加路由 addRoutes
  function addRoutes(newRoutes) {
    createRouteMap(newRoutes, pathMap)
  };

  // 2. 匹配: 路径<->组件
  function match(path) {

  };
  return {
    addRoutes,
    match
  }
}